package com.service.impl;

import com.service.Webservice;
import org.apache.commons.lang3.StringUtils;
import org.springframework.ws.soap.server.endpoint.annotation.SoapAction;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

/**
 * Created by huangwei
 * 19/03/04 13:37
 */
@WebService
public class Webserviceimpl implements Webservice {
    @Override
    public String GetSchema(@WebParam(name = "schemaCode")String schemaCode) {

        System.out.println(schemaCode);
        return " {\"Code\":\"D001062ceshi2\",\"Items\":[{\"Name\":\"F0000001\",\"DisplayName\":\"单行文本\",\"DataType\":\"String\"},]}";
    }


    @Override
    public String GetSchemaList() {
        return  "{\"customer\": \"测试\",\"D001062ceshi2\": \"测试\"}";
    }

    @Override
    public String GetList(@WebParam(name = "userId ") String userId,
                          @WebParam(name = "schemaCode") String schemaCode,
                          @WebParam(name = "filter") String filter) {
           return  "{\"Code\":\"0\",\"Message\":\"获取数据成功\",\"Schema\":{\"Code\":\"D001062ceshi2\",\"Items\":[{\"name\":\"F0000001\",\"DisplayName\":\"单行文本\",\"DataType\":\"String\"}],},\"Data\":[\"F0000001\":\"c而是\"]}";
    }

    @Override
    @WebMethod(operationName = "Invoke", action = "http://tempuri.org/Invoke")
    @SoapAction("http://tempuri.org/Invoke")
    public String Invoke(@WebParam(name = "userCode") String userCode,
                         @WebParam(name = "schemaCode") String schemaCode,
                         @WebParam(name = "methodName") String methodName,
                         @WebParam(name = "param") String param) {
        System.out.println(param);
        System.out.println(userCode);
        System.out.println(schemaCode);
        System.out.println(methodName);
        return "{\"customer\": \""+param+"\",\"D001062ceshi2\": \"测试\"}";
    }
}
